Embodiments of the present disclosure are concerned with providing a computer-implemented method, a computer program product and a computer system that facilitate message queue management.
A service provider responding to client requests from a number of web based applications typically needs more than one server. The service provider distributes tasks requested by clients to applications across an array of individual servers, called server clusters. Clients make requests to applications running on the individual servers in the server cluster through a web browser in order to receive results from the applications. The sending of requests, and the receiving of results may take place using TCP/IP protocols, e.g. over the Internet, for example in a series of Hypertext Transfer Protocol (HTTP) communications between the client and the server. Examples of such communications over the connection between the client and server include selecting and purchasing goods from an online retailer or performing a series of banking transactions.
The provider of the server cluster maintains a long-lived connection state by employing a mechanism so that individual client requests are sent to the same server across multiple requests in a conversation. This is sometimes referred to as a persistent connection between the server and client, as the connection persists beyond the handling of an isolated request from the client by the server. As additional clients access the server cluster, new connections will be created between the clients and assigned servers. If too many connections are assigned to a single server, the server may become overloaded causing a range of performance problems including system failure. Therefore, new connections will be distributed to different servers across the server cluster to balance the server load within the server cluster. The distribution of connections across the different servers on a cluster is called load balancing.
When a request for a service is made, e.g. via a TCP/IP protocol, it is more efficient to make the connections persist at the end of one request to avoid the overhead of connection establishment for subsequent requests from the client to the server cluster. Connections are typically balanced when the connections are established using a dedicated component referred to as the network connection balancer, which directs the connections to a particular server in the cluster based on a monitored utilization of the server's capacity to handle client connections. This is typically achieved using a suitable load balancing algorithm. After the connection has been established, the network connection balancer typically is no longer involved in managing the work flow over the established connection; instead, requests simply flow over the persistent connection between the client and the server to which the client is connected.
As workloads from the service consumers vary, they may or may not provoke new connections to be made, but existing persistent connections are unlikely to be affected and will continue to be bound to their initial server instances. This can lead to suboptimal balancing of the workload across the server cluster where the overall connection capacity of the server cluster is increased, for example by new servers entering the cluster or by existing servers increasing their client connection capacity, e.g. when an independent task performed by such a server that restricts the ability of the server to accept client connections is completed.
As the rebalancing of existing persistent connections is typically outside the scope of a network balancing component as previously explained, the additional capacity of the server cluster remains unused by such persistent connections. In contrast, where the capacity of the server cluster is reduced, this normally automatically leads to rebalancing of persistent connections due to the fact that the reduction in capacity is typically associated with the termination of a subset of these persistent connections, which are subsequently reconnected after receiving a client request thereto by the network connection balancer implementing a suitable load balancing algorithm.
It is furthermore undesirable at least for reasons of implementation complexity to involve the network connection balancer in rebalancing persistent connections. Connection management of persistent connections is the prerogative of the network endpoints, i.e., the client and server, as middleware components can use server-specific protocols to ensure state and transaction integrity can be maintained, which protocols cannot be easily transferred between servers. Consequently, the network connection balancer are typically not be involved in the process of persistent connection termination. Nevertheless, there exists a need for rebalancing persistent connections in case of an increase of connection handling capacity of a server cluster.